import Vue from 'vue'
import router from '@/router'
import store from '@/store/index.js'
import directives from '@/directives/index.js'
import { EventBus } from '@/utils/eventBus.js'
import { getBrowserName } from '@/utils/index'
import App from './App.vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import JsonExcel from 'vue-json-excel'
import './styles/index.scss'
// 引入 formCreate
import formCreate from '@form-create/element-ui'

Vue.config.productionTip = false
Vue.prototype.$store = store
Vue.prototype.$EventBus = EventBus

Vue.use(ElementUI)
Vue.use(formCreate)

Vue.component('ExcelDown', JsonExcel)
Object.keys(directives).forEach(item => {
  Vue.directive(item, directives[item])
})
console.log('browser: ', getBrowserName());
console.log('mainjs log', process.env.NODE_ENV);
console.log('routers', router.getRoutes());
new Vue({
  store,
  router,
  render: h => h(App),
}).$mount('#app')